Computer-aided Real-time Automatic Quality-control System